"""MyCMS URL Configuration

The `urlpatterns` list routes URLs to views. For more information please see:
    https://docs.djangoproject.com/en/1.10/topics/http/urls/
Examples:
Function views
    1. Add an import:  from my_app import views
    2. Add a URL to urlpatterns:  url(r'^$', views.home, name='home')
Class-based views
    1. Add an import:  from other_app.views import Home
    2. Add a URL to urlpatterns:  url(r'^$', Home.as_view(), name='home')
Including another URLconf
    1. Import the include() function: from django.conf.urls import url, include
    2. Add a URL to urlpatterns:  url(r'^blog/', include('blog.urls'))
"""
from django.conf.urls import url, include


from webadmin import views
from webadmin.views_dir import article_management, column_management, roles_management, rights_management, tag_management, user_management


urlpatterns = [
    url(r'^account/password/', views.password, name="password"),     # 密码管理
    url(r'^account/login/', views.login, name="login"),     # 登录
    url(r'^account/logout/', views.logout, name="logout"),     # 登出

    # 文章管理
    url(r'^article_management/(?P<oper_type>\w+)/(?P<o_id>\w+)/', article_management.article_management_oper),
    url(r'^article_management/', article_management.article_management, name="article_management"),

    # 栏目管理
    url(r'^column_management/(?P<oper_type>\w+)/(?P<o_id>\w+)/', column_management.column_management_oper),
    url(r'^column_management/', column_management.column_management, name="column_management"),

    # 标签管理
    url(r'^tag_management/(?P<oper_type>\w+)/(?P<o_id>\w+)/', tag_management.tag_management_oper),
    url(r'^tag_management/', tag_management.tag_management, name="tag_management"),


    # 用户管理
    url(r'^user_management/(?P<oper_type>\w+)/(?P<o_id>\w+)/', user_management.user_management_oper),
    url(r'^user_management/', user_management.user_management, name="user_management"),

    # 角色管理
    url(r'^roles_management/(?P<oper_type>\w+)/(?P<o_id>\w+)/', roles_management.roles_management_oper),
    url(r'^roles_management/', roles_management.roles_management, name="roles_management"),

    # 权限管理
    url(r'^rights_management/(?P<oper_type>\w+)/(?P<o_id>\w+)/', rights_management.rights_management_oper),
    url(r'^rights_management/', rights_management.rights_management, name="rights_management"),


    url(r'^img_upLoad/$', views.img_upLoad, name='img_upLoad'),       # 图片上传
    url(r'^dwz.frag.xml', views.dwz_frag_xml),
    url(r'', views.admin_index, name='admin_index'),    # 首页

]
